package com.ts.tsavplayer.player

import android.util.Log
import android.view.Surface

class AVPlayer{
    companion object {
        // Used to load the 'tsavplayer' library on application startup.
        init {
            System.loadLibrary("tsavplayer")
        }
        //player type

        const val FFMEDIA_PLAYER: Int = 0

        const val HWCODEC_PLAYER: Int = 1
        const val VIDEO_RENDER_OPENGL: Int = 0

        const val VIDEO_RENDER_ANWINDOW: Int = 1

        const val VIDEO_RENDER_3D_VR: Int = 2



    }
    fun init(url:String,playerType:Int,renderType:Int,  surface:Surface):Long{
       return native_Init1(url,playerType,renderType,surface);
    }
    external fun native_Init1(url:String,playerType:Int,renderType:Int,  surface:Any):Long


    private  val TAG = "AVPlayer"
    external fun play( playerHandle:Long);
    private fun playerEventCallback(msgType: Int, msgValue: Float) {
        Log.e(TAG,""+msgType+" "+msgType);
//        if (mEventCallback != null) mEventCallback.onPlayerEvent(msgType, msgValue)
    }

}
